/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: avaj llik
 * License Type: Purchased
 */
package orm;

import org.orm.*;
import java.io.Serializable;
import javax.persistence.*;
/**
 * Entidad Encargada de gestionar la publicación de ofertas
 */
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="tcp_publicacion")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Tcp_publicacion implements Serializable {
	public Tcp_publicacion() {
	}
	
	private void this_setOwner(Object owner, int key) {
		if (key == orm.ORMConstants.KEY_TCP_PUBLICACION_PUB_ID_PERSONA) {
			this.pub_id_persona = (orm.Tcp_persona) owner;
		}
	}
	
	@Transient	
	org.orm.util.ORMAdapter _ormAdapter = new org.orm.util.AbstractORMAdapter() {
		public void setOwner(Object owner, int key) {
			this_setOwner(owner, key);
		}
		
	};
	
	@Column(name="pub_id", nullable=false)	
	@Id	
	@GeneratedValue(generator="VAC16051212C8A5FB0A9018BF")	
	@org.hibernate.annotations.GenericGenerator(name="VAC16051212C8A5FB0A9018BF", strategy="increment")	
	private int pub_id;
	
	@Column(name="pub_monto", nullable=true, length=10)	
	private Integer pub_monto;
	
	@Column(name="pub_descripcion", nullable=true, length=255)	
	private String pub_descripcion;
	
	@ManyToOne(targetEntity=orm.Tcp_persona.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="pub_id_persona", referencedColumnName="pers_id") })	
	@Basic(fetch=FetchType.LAZY)	
	private orm.Tcp_persona pub_id_persona;
	
	private void setPub_id(int value) {
		this.pub_id = value;
	}
	
	public int getPub_id() {
		return pub_id;
	}
	
	public int getORMID() {
		return getPub_id();
	}
	
	/**
	 * Monto del Producto.
	 */
	public void setPub_monto(int value) {
		setPub_monto(new Integer(value));
	}
	
	/**
	 * Monto del Producto.
	 */
	public void setPub_monto(Integer value) {
		this.pub_monto = value;
	}
	
	/**
	 * Monto del Producto.
	 */
	public Integer getPub_monto() {
		return pub_monto;
	}
	
	/**
	 * Descripción de la Oferta.
	 */
	public void setPub_descripcion(String value) {
		this.pub_descripcion = value;
	}
	
	/**
	 * Descripción de la Oferta.
	 */
	public String getPub_descripcion() {
		return pub_descripcion;
	}
	
	public void setPub_id_persona(orm.Tcp_persona value) {
		if (pub_id_persona != null) {
			pub_id_persona.tcp_publicacion.remove(this);
		}
		if (value != null) {
			value.tcp_publicacion.add(this);
		}
	}
	
	public orm.Tcp_persona getPub_id_persona() {
		return pub_id_persona;
	}
	
	/**
	 * This method is for internal use only.
	 */
	public void setORM_Pub_id_persona(orm.Tcp_persona value) {
		this.pub_id_persona = value;
	}
	
	private orm.Tcp_persona getORM_Pub_id_persona() {
		return pub_id_persona;
	}
	
	public String toString() {
		return String.valueOf(getPub_id());
	}
	
}
